FROM openjdk:8-jdk
WORKDIR /srv
VOLUME /srv/logs
ARG JAR_FILE
COPY ${JAR_FILE} /srv/app.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
ENV JAVA_OPTS='-Xms256M -Xmx512M -Xss512k -XX:MetaspaceSize=64M -XX:MaxMetaspaceSize=128M'
ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar ./app.jar"]